package com.ceshiren.chnjx.wework.exception_handle;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

/**
 * @author JJJJ
 * @Title:
 * @date 2021/11/8下午7:45
 * @Description: 处理弹框异常
 */
public class PopupExceptionHandler extends ExceptionHandler {


    @Override
    public boolean isHit(String pageSource) {
        return pageSource.contains("等待") && pageSource.contains("关闭");

    }

    @Override
    public void handle(WebDriver driver) {
        driver.findElement(By.xpath("//*[@text='等待']")).click();
    }
}
